package com.yanqu.backendweb.config;

import com.yanqu.backendweb.entity.TSDbInfo;
import com.yanqu.backendweb.entity.TSServerList;

import java.util.concurrent.ConcurrentHashMap;

public class ServerDbMgr {

    public ServerDbMgr(){

    }

    /**
     * TSDbInfo
     */
    private static ConcurrentHashMap<Integer, TSDbInfo> dbInfoHashMapN;

    /**
     * SERVER_LIST
     */
    private static ConcurrentHashMap<Integer, TSServerList> serverListConcurrentHashMapN;


    public static ConcurrentHashMap<Integer, TSDbInfo> getDbInfoHashMap() {
        return dbInfoHashMapN;
    }

    public static void setDbInfoHashMap(ConcurrentHashMap<Integer, TSDbInfo> dbInfoHashMap) {
        dbInfoHashMapN = dbInfoHashMap;
    }

    public static ConcurrentHashMap<Integer, TSServerList> getServerListConcurrentHashMap() {
        return serverListConcurrentHashMapN;
    }

    public static void setServerListConcurrentHashMap(ConcurrentHashMap<Integer, TSServerList> serverListConcurrentHashMap) {
        serverListConcurrentHashMapN = serverListConcurrentHashMap;
    }


    public static TSDbInfo getDbInfoByServerId(Integer serverId){
        return dbInfoHashMapN.get(serverId);
    }

    public static TSServerList getServerByServerId(Integer serverId){
        return serverListConcurrentHashMapN.get(serverId);
    }

}
